<?php
/**
 * @version		$Id: edit.php 18871 2010-09-13 14:27:48Z chdemko $
 * @package		Joomla.Administrator
 * @subpackage	com_texts
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.DS.'helpers'.DS.'html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>
<script type="text/javascript">
	function submitbutton(task)
	{
		if (task == 'text.cancel' || document.formvalidator.isValid(document.id('text-form'))) {
			Joomla.submitform(task, document.getElementById('text-form'));
		}
	}
</script>

<form action="<?php echo JRoute::_('index.php?option=com_jetext_2&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="text-form" class="form-validate" enctype="multipart/form-data">
	<div class="width-60 fltlft">
		<fieldset class="adminform">
			<legend><?php echo empty($this->item->id) ? JText::_('COM_JETEXT_NEW_TEXT') : JText::sprintf('COM_JETEXT_TEXT_DETAILS', $this->item->id); ?></legend>
			<ul class="adminformlist">
				<li><?php echo $this->form->getLabel('access'); ?>
				<?php echo $this->form->getInput('access'); ?></li>

				<li><?php echo $this->form->getLabel('catid'); ?>
				<?php echo $this->form->getInput('catid'); ?></li>
				
				<li><?php echo $this->form->getLabel('org_id'); ?>
				<?php echo $this->form->getInput('org_id'); ?></li>
				
				<li><?php echo $this->form->getLabel('type_id'); ?>
				<?php echo $this->form->getInput('type_id'); ?></li>
				
				<li><?php echo $this->form->getLabel('working_kind_id'); ?>
				<?php echo $this->form->getInput('working_kind_id'); ?></li>
				
				<li><?php echo $this->form->getLabel('still_valid'); ?>
				<?php echo $this->form->getInput('still_valid'); ?></li>

				<li><?php echo $this->form->getLabel('text_code'); ?>
				<?php echo $this->form->getInput('text_code'); ?></li>
				
				<li><?php echo $this->form->getLabel('signer'); ?>
				<?php echo $this->form->getInput('signer'); ?></li>

				<li><?php echo $this->form->getLabel('text_created'); ?>
				<?php echo $this->form->getInput('text_created'); ?></li>
				
				<li>
					<label>&nbsp;</label>
					<small style="float:left;">B&#7855;t bu&#7897;c nh&#7853;p ng&agrave;y th&aacute;ng n&#259;m theo &#273;&#7883;nh d&#7841;ng YYYY-MM-DD (v&iacute; d&#7909;: 2010-10-20)</small>
				</li>
				
				<li><?php echo $this->form->getLabel('text_file'); ?>
				<?php echo $this->form->getInput('text_file'); ?></li>
				
				<?php if($this->item->text_file): ?>
				<li>				
					<div class="clr"><span></span></div>
					<label>&nbsp;</label>
					<input type="checkbox" name="delete_file" value="1" style="margin:0; margin-right: 5px; " /> X&oacute;a File: <strong><?php echo $this->item->text_file?></strong> ?
				</li>
				<?php endif; ?>
				
				<li><?php echo $this->form->getLabel('state'); ?>
				<?php echo $this->form->getInput('state'); ?></li>

				<li>
				<div id="image">
					<?php foreach($this->form->getFieldset('image') as $field): ?>
						<?php if (!$field->hidden): ?>
							<?php echo $field->label; ?>
						<?php endif; ?>
						<?php echo $field->input; ?>
					<?php endforeach; ?>
				</div>
				</li>

				<li><?php echo $this->form->getLabel('description'); ?>
				<?php echo $this->form->getInput('description'); ?></li>

				<li><?php echo $this->form->getLabel('language'); ?>
				<?php echo $this->form->getInput('language'); ?></li>

				<li><?php echo $this->form->getLabel('id'); ?>
				<?php echo $this->form->getInput('id'); ?></li>
			</ul>
			<div class="clr"> </div>

		</fieldset>
	</div>

<div class="width-40 fltrt">
	<?php echo JHtml::_('sliders.start','text-sliders-'.$this->item->id, array('useCookie'=>1)); ?>

	<?php echo JHtml::_('sliders.panel',JText::_('COM_JETEXT_GROUP_LABEL_PUBLISHING_DETAILS'), 'publishing-details'); ?>
		<fieldset class="panelform">
		<ul class="adminformlist">
			<?php foreach($this->form->getFieldset('publish') as $field): ?>
				<li>
					<?php if (!$field->hidden): ?>
						<?php echo $field->label; ?>
					<?php endif; ?>
					<?php echo $field->input; ?>
				</li>
			<?php endforeach; ?>
			</ul>
		</fieldset>

	<?php echo JHtml::_('sliders.end'); ?>
	<input type="hidden" name="task" value="" />
	<?php echo JHtml::_('form.token'); ?>
</div>

<div class="clr"></div>
</form>
